using System;
using Castle.Windsor;
using Castle.Windsor.Configuration.Interpreters;

namespace Tickets.WebUI
{
	public class ServiceLocator
	{
		private static WindsorContainer container;

		public static void Initialize()
		{
			container = new WindsorContainer(new XmlInterpreter());
		}

		public static void Dispose()
		{
			container.Dispose();
		}

		public static object Resolve(string serviceName)
		{
			return container.Resolve(serviceName);
		}

		public static object Resolve(Type serviceType)
		{
			return container.Resolve(serviceType);
		}

		public static IWindsorContainer Container
		{
			get { return container; }
		}

	}
}
